package com.superc.lib.helper;

import java.io.File;

import android.content.Context;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Vibrator;

public final class AndroidHelper {
	
	public static void ShowShock(Context context,long times){
		Vibrator vibrator  = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);    
	    vibrator.vibrate(times);  
	}
	
	public static void PlayMusic(Context context,String fileName){
		MediaPlayer player=MediaPlayer.create(context, Uri.fromFile(new File(fileName)));
		player.setOnCompletionListener(new OnCompletionListener() {
			@Override
			public void onCompletion(MediaPlayer mp) {
				mp.release();
			}
		});
		player.start();
	}
	
	
}
